package com.jt.controller;

import com.jt.pojo.Rights;
import com.jt.service.RightsService;
import com.jt.vo.SySResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/rights")
public class RightsController {
    @Autowired
    private RightsService service;
    @GetMapping("/getRightsList")//左连接查询
    public SySResult getRightsList(){
        List<Rights> list = service.getRightsList();
        return SySResult.success(list);
    }
    @GetMapping("/getRightsList2")//子查询
    public SySResult getRightsList2(){
        List<Rights> list = service.getRightsList2();
        return SySResult.success(list);
    }
}
